<?php if (!defined('MAX_ON')){echo "<h1>ACCESS DENIED</h1>You cannot access this file directly.";exit();} ?>
<?php if ($template_hook=='start'){ ?>
<?php }elseif ($template_hook=='1'){ ?>
		<!-- forum stats -->
		<table class="forum-board-forum-head" cellspacing="0" cellpadding="0" width="100%">
			<tr>
				<td class="forum-topic-subject"><?php echo $lang['online_stats_header']; ?></td>
				<td class="forum-topic-subscribe"><a class="forum-header" href="javascript:setstate('forum_stats');"><img  src="<?php echo "$topic_collapse_img"; ?>" /></a></td>
			</tr>
			
			
			<tr><td class="forum-index-stats-sub" colspan="2">
				<!-- show the current time -->
				<?php echo $lang['index_time']; ?> <?php echo "$time"; ?>
			</td></tr>
		</table>
<?php if ($_COOKIE['forum_stats']=='0'){ ?>
		<table class="forum-index forum-index-top" id="forum_stats" style="display: none;" cellpadding="0" cellspacing="0">
<?php }else{ ?>
		<table class="forum-index forum-index-top" id="forum_stats" cellpadding="0" cellspacing="0">
<?php } ?>
			<tr>
                <td colspan="2" class="forum-index-stats-header">
                    <?php echo $lang['online_stats_statistics']; ?>
                </td>
            </tr>
			<tr>
				<td class="forum-index-td-stats">
					<img  src="<?php echo "$forum_stats_img"; ?>" alt="<?php echo $lang['online_stats_header']; ?>" />
				</td>
				<td class="forum-index-td-online">
					<?php echo $lang['online_stats_posts']; ?> <?php echo $lang['online_stats_member']; ?>
					<?php echo member_link($member_id, 0, 1); ?><br />
<?php if ($can_view_forum=='0'){ ?>
					<?php echo $lang['online_stats_latest']; ?> <?php echo $lang['online_stats_restricted']; ?> (<?php echo "$topic_time"; ?>)
<?php }elseif ($can_read_topics=='0'){ ?>
					<?php echo $lang['online_stats_latest']; ?> <?php echo $lang['online_stats_restricted']; ?> (<?php echo "$topic_time"; ?>)
<?php }else{ ?>
					<?php echo $lang['online_stats_latest']; ?> <a class="forum-index-link-to-topic" href="<?php echo max_link("index.php?page=findpost&post=$id","findpost/$id"); ?>"><?php echo "$title"; ?></a> (<?php echo "$topic_time"; ?>)
<?php } ?>
				</td>
			</tr>
			<tr>
            	<td colspan="2" class="forum-index-stats-header">
					<?php echo $lang['online_stats_online']; ?>
				</td>
			</tr>
			<tr>
				<td class="forum-index-td-stats">
					<img  src="<?php echo "$whos_online_img"; ?>" alt="<?php echo $lang['online_stats_who']; ?>" />
				</td>
				<td class="forum-index-td-online" style="padding-top: 5px;">
<?php } elseif($template_hook=='2'){ ?>
<?php } elseif($template_hook=='3'){ ?>
					<!-- show online -->				
					<a class="forum-index-link-to-topic" href="<?php echo max_link("index.php?page=list","online-now"); ?>"><span style="font-weight: normal;"><?php echo $lang['online_stats_recent']; ?></span></a>
<br />
<?php } elseif($template_hook=='4'){ ?>
					<span class="bot-group-color"><i><?php echo "$name"; ?></i></span>
<?php } elseif($template_hook=='5'){ ?>
					<?php echo member_link($id, '1', '1', '1'); ?>	
<?php } elseif($template_hook=='6'){ ?>
					<span class="bot-group-color"><i><?php echo "$name"; ?></i></span>, 
<?php } elseif($template_hook=='7'){ ?>
					<?php echo member_link($id, '1', '1', '1'); ?>,
<?php } elseif($template_hook=='8'){ ?>
					<hr />
					<?php echo $lang['online_stats_today']; ?><br />
<?php } elseif($template_hook=='9'){ ?>
					<?php echo member_link($id, '1'); ?>	
<?php } elseif($template_hook=='10'){ ?>
					<?php echo member_link($id, '1'); ?>,	
<?php } elseif($template_hook=='11'){ ?>
					<!-- show most users online -->
					<br />
					<?php echo $lang['online_stats_most']; ?>
				</td>
			</tr>
			<tr>
            	<td colspan="2" class="forum-index-td-stats" style="height:25px">
<?php } elseif($template_hook=='24'){ ?>
					<a class="state_group" href="<?php echo max_link("index.php?page=list&group=$group_id", "list/group/$group_id"); ?>"><?php echo $group_loop; ?></a><?php echo $group_slash; ?>
<?php } elseif($template_hook=='25'){ ?>
				</td>
			</tr>
<?php } elseif($template_hook=='12'){ ?>
			<tr>
				<td colspan="2">
	<table cellspacing="1" width="100%" align="center" border="0">
		<tbody>
		<tr class="h_right">
			<td class="thead1" valign="top" width="25%"><?php echo $lang['online_new_members']; ?></td>
			<td class="thead1" width="25%"><?php echo $lang['online_best_topics']; ?></td>
			<td class="thead1" valign="top" width="50%">&nbsp;<?php echo $lang['online_last_posts']; ?></td>
		</tr>
		<tr class="h_right">
			<td class="row3" style="vertical-align: top" width="25%">
			<table style="border-collapse: collapse" cellpadding="0" width="100%" border="0">
				<tbody>
<?php } elseif($template_hook=='13'){ ?>
					<tr>
						<td class="row3 h_right" noWrap width="100%"><?php echo member_link($user_id_new, '1'); ?></td>
						<td class="row3 h_left" noWrap width="1%">&nbsp;<span class="smallfont"><?php echo $reg_date_new; ?></span></td>
					</tr>
<?php } elseif($template_hook=='14'){ ?>
				</tbody>
			</table>
			</td>
			<td class="row3" style="vertical-align: top" width="25%">
			<table style="border-collapse: collapse" cellpadding="0" width="100%" border="0">
				<tbody>
<?php } elseif($template_hook=='15'){ ?>
					<tr>
						<td class="row3 h_right" width="99%"><img alt="" src="<?php echo $post_img; ?>" border="0">&nbsp; <a href="<?php echo max_link("index.php?topic=$title_seo_best", "topic/$id_best_post-$title_seo_best"); ?>"><span class=smallfont><?php echo $title_bset; ?></span></a></td>
						<td class="row3 h_left" noWrap width="1%"><?php echo $num_bset_post; ?></td>
					</tr>
<?php } elseif($template_hook=='16'){ ?>
				</tbody>
			</table>
			</td>
			<td class="row3" valign="top" width="50%" rowspan="3">
			<table style="border-collapse: collapse; height: 100%" cellpadding="0" width="100%" border="0">
				<tbody>
					<tr style="vertical-align: top">
						<td class="row3 h_right" noWrap><?php echo $lang['online_subject']; ?></td>
						<td>&nbsp;</td>
						<td class="row3 h_right" noWrap>&nbsp;<?php echo $lang['online_send_by']; ?></td>
					</tr>
<?php } elseif($template_hook=='17'){ ?>
					<tr valign="top">
						<td class="row3 h_right" title="<?php echo $title_post_no; ?>"><img alt="" src="<?php echo $post_img; ?>" border="0">&nbsp; <a href="<?php echo max_link("index.php?topic=$topic_id", "topic/$topic_title-$topic_id"); ?>"><span class="smallfont"><?php echo $title_post; ?></span></a></td>
						<td class="row3 h_right" title="<?php echo $title_post_no; ?>" noWrap><a href="<?php echo max_link("index.php?topic=$topic_id", "topic/$topic_title-$topic_id"); ?>" target="_blank"><img alt="" src="<?php echo $topic_collapse_img; ?>" border="0"></a> </td>
						<td class="row3 h_right" title="" noWrap><?php echo member_link($member_id_post, '1'); ?></td>
					</tr>
<?php } elseif($template_hook=='18'){ ?>
				</tbody>
			</table>
			</td>
		</tr>
		<tr class="h_right">
					<td class="thead1" width="25%"><?php echo $lang['online_best_cats']; ?></td>
					<td class="thead1" width="25%"><?php echo $lang['online_best_members']; ?></td>
		</tr>
		<tr class="h_right">
			<td class="row3" style="vertical-align: top" width="25%">
			<table style="border-collapse: collapse" cellpadding="0" width="100%" border="0">
				<tbody>
<?php } elseif($template_hook=='19'){ ?>
					<tr>
						<td class="row3 h_right" title="<?php echo $cat_name_best; ?>" noWrap><a href="<?php echo max_link("index.php?forum=$cat_id_best", "forum/$cat_url_best-$cat_id_best"); ?>"><?php echo $cat_name_best; ?></a></td>
						<td class="row3 h_left" noWrap width="1%"><?php echo $num_cat_best; ?></td>
					</tr>
<?php } elseif($template_hook=='20'){ ?>
				</tbody>
			</table>
			</td>
			<td class="row3" style="vertical-align: top" width="25%">
			<table style="border-collapse: collapse" cellpadding="0" width="100%" border="0">
				<tbody>
<?php } elseif($template_hook=='21'){ ?>
					<tr>
						<td class="row3 h_right" noWrap><?php echo member_link($id_user_stat, '1'); ?></td>
						<td class="row3 h_left" noWrap width="1%"><?php echo $num_user_post; ?></td>
					</tr>
<?php } elseif($template_hook=='22'){ ?>
				</tbody>
			</table>
			</td>
		</tr>
		</tbody>
	</table>
				</td>
			</tr>
<?php } elseif($template_hook=='23'){ ?>
		</table>
		<table class="forum-index-forum-footer" cellpadding="0" cellspacing="0">
			<tr><td class="forum-index-forum-footer-contents"> </td></tr>
		</table>
<?php if($menu_block=="1"){ ?>
		</td>
		<script type="text/javascript">
var expandImage = "images/forums/tab-expanded.gif"; 
var collapseImage = "images/forums/tab-collapsed.gif"; 

window.onload=init;

function init()
{
      var prev = readCookie('hide');
	  var hiddenDivId = 'nav_forum';
		if( prev != null ){
			document.getElementById(hiddenDivId).style.display = "none";
		} else {
			document.getElementById(hiddenDivId).style.display = "";
		}
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function setDefaultExpanderImages(expandImgName, collapseImgName) {
    expandImage = expandImgName;
	collapseImage = collapseImgName;
}

function toggleBlockImage (hiddenDivId, expander, expandImageName, collapseImageName) {
    if (document.getElementById) {
        if (document.getElementById(hiddenDivId).style.display == "none") {
            document.getElementById(hiddenDivId).style.display = "";
			expander.src = (collapseImageName)?collapseImageName:collapseImage;
			eraseCookie('hide');
        } else {
            document.getElementById(hiddenDivId).style.display = "none";
            expander.src = (expandImageName)?expandImageName:expandImage;
			createCookie('hide','1',10);
        } 
    }
}
		</script>
		<div id="sidebar_container">
		<a href="#">
			<img id="sidebar_button" onClick="toggleBlockImage('nav_forum', this, '<?php echo $tab_expanded; ?>', '<?php echo $tab_collapsed; ?>');" width="22" src="<?php echo $tab_collapsed; ?>" alt="" />
		</a>
		</div>
		<td width="100%" class="td-nav" valign="top" border="10" id="nav_forum">
<?php } ?>
<?php } elseif($template_hook=='28'){ ?>
			<div style="width: 237px">
				<div>
					<div class="forum-topic-subscribe h_right">
						<span style="float: <?php echo $lang['header_left']; ?>;"><a class="forum-header" href="javascript:setstate('forum_nav1');"><img  src="<?php echo "$topic_collapse_img"; ?>" /></a></span>
						<a class="forum-header" href="#"><?php echo $block['1']; ?></a>
					</div>
				</div>
				<div id="forum_nav1">
					<div class="forum-index-said_bar">
						<?php if($block['3'] == "0"){echo $block['2'];}else{include($max_root."blocks/".$block['3']."_block/index.php");}; ?>
					</div>
				</div>
				<table class="forum-index-forum-footer" cellpadding="0" cellspacing="0">
					<tr><td class="forum-index-forum-footer-contents"> </td></tr>
				</table>
			</div>
<?php } elseif($template_hook=='29'){ ?>
<?php if ($tags_settings=="1" AND $tag_res){ ?>
<?php if($menu_block=="1"){ ?>
			<div style="width: 237px">
				<div>
					<div class="forum-topic-subscribe h_right">
					<span style="float: <?php echo $lang['header_left']; ?>;">
					<a class="forum-header" href="javascript:setstate('forum_nav3');"><img  src="<?php echo "$topic_collapse_img"; ?>" /></a></span>
					<a class="forum-header" href="#"><?php echo $lang['block_tags']; ?></a></div>
				</div>
				<div id="forum_nav3">
					<div class="forum-index-said_bar">
<?php } ?>
<?php } ?>
<?php } elseif($template_hook=='26'){ ?>
<?php if ($tags_settings=="1" AND $tag_res){ ?>
<?php if ($menu_block=="1"){ ?>
						<span style="padding-<?php echo $lang['header_right']; ?>:10px;"><a href='<?php echo "$max_domain"; ?>/index.php?page=search&search=<?php echo $tag_title; ?>&pf=1'><?php echo $tag_title; ?></a></span>
<?php } ?>
<?php } ?>
<?php } elseif($template_hook=='27'){ ?>
<?php if ($menu_block=="1"){ ?>
<?php if ($tags_settings=="1" AND $tag_res){ ?>
					</div>
				</div>
				<table class="forum-index-forum-footer" cellpadding="0" cellspacing="0">
					<tr><td class="forum-index-forum-footer-contents"> </td></tr>
				</table>
			</div>
<?php } ?>
		</td>
	</tr>
</table>
<?php } ?>
<?php }elseif ($template_hook=='end'){ ?>
<?php } ?>
